<template>
  <ul class="todo-main">
    <Item v-for="item in todoList" :key="item.id" v-bind="item" :alterDone="alterDone" :deleteItem="deleteItem"/>
  </ul>
</template>

<script lang="ts">
import {defineComponent} from "vue";

export default defineComponent({
  name: "List",
});
</script>

<script setup lang="ts">
import Item from "./components/Item/index.vue";
import type {TodosType} from "../../type/toList";
import {ref} from "vue";
//接收props的方法1
/* const props = defineProps(["todoList"]);
console.log(props); */

//接收props的方法2
interface propsType {
  todoList: TodosType;
  alterDone: (id: string) => void;
  deleteItem: (id: string) => void;
}

defineProps<propsType>();
</script>

<style scoped>
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}
</style>
